<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <meta name="description" content="后端Python3+Flask结合Socket.io配合前端Vue2.0实现简单全双工在线客服系统​    Socket.IO 就是一个封装了 Websocket、基于 Node 的 JavaScript 框架，包含 client 的 JavaScript 和 server 的 Node（现在也支持" />
  

  
  
  
  
  
  
  <title>python3+Flask结合Socket.io简单实现在线客服系统 | 南辞的技术博客</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="后端Python3+Flask结合Socket.io配合前端Vue2.0实现简单全双工在线客服系统​    Socket.IO 就是一个封装了 Websocket、基于 Node 的 JavaScript 框架，包含 client 的 JavaScript 和 server 的 Node（现在也支持python,go lang等语言）。其屏蔽了所有底层细节，让顶层调用非常简单，另外，Socket.">
<meta property="og:type" content="article">
<meta property="og:title" content="python3+Flask结合Socket.io简单实现在线客服系统">
<meta property="og:url" content="https://yanlidoushikeke.gitee.io/myhexo/2021/04/23/python3-Flask%E7%BB%93%E5%90%88Socket-io%E7%AE%80%E5%8D%95%E5%AE%9E%E7%8E%B0%E5%9C%A8%E7%BA%BF%E5%AE%A2%E6%9C%8D%E7%B3%BB%E7%BB%9F/index.html">
<meta property="og:site_name" content="南辞的技术博客">
<meta property="og:description" content="后端Python3+Flask结合Socket.io配合前端Vue2.0实现简单全双工在线客服系统​    Socket.IO 就是一个封装了 Websocket、基于 Node 的 JavaScript 框架，包含 client 的 JavaScript 和 server 的 Node（现在也支持python,go lang等语言）。其屏蔽了所有底层细节，让顶层调用非常简单，另外，Socket.">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://v3u.cn/v3u/Public/js/editor/attached/20200624210612_96391.png">
<meta property="og:image" content="https://v3u.cn/v3u/Public/js/editor/attached/20200624220630_72542.png">
<meta property="og:image" content="https://v3u.cn/v3u/Public/js/editor/attached/20200624220655_38621.png">
<meta property="article:published_time" content="2021-04-23T07:54:23.000Z">
<meta property="article:modified_time" content="2021-04-23T08:01:28.034Z">
<meta property="article:author" content="南辞">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://v3u.cn/v3u/Public/js/editor/attached/20200624210612_96391.png">
  
  
    <link rel="icon" href="/tefuir/css/images/favicon.ico">
  
  
<link rel="stylesheet" href="/tefuir/css/style.css">

  

  
  <!-- baidu webmaster push -->
  <script src='//push.zhanzhang.baidu.com/push.js'></script>
<meta name="generator" content="Hexo 5.2.0"><link rel="alternate" href="/tefuir/atom.xml" title="南辞的技术博客" type="application/atom+xml">
</head>
<body class="home blog custom-background custom-font-enabled single-author">
  <div id="page" class="hfeed site">
      <header id="masthead" class="site-header" role="banner">
    <hgroup>
      <h1 class="site-title">
        <a href="/tefuir/" title="南辞的技术博客" rel="home">南辞的技术博客</a>
      </h1>
      
        <h2 class="site-description hitokoto"></h2>
        <script type="text/javascript" src="https://v1.hitokoto.cn/?encode=js"></script>
      
    </hgroup>

    <nav id="site-navigation" class="main-navigation" role="navigation">
            <button class="menu-toggle">菜单</button>
            <a class="assistive-text" href="/#content" title="跳至内容">跳至内容</a><!--TODO-->
            <div class="menu-main-container">
                <ul id="menu-main" class="nav-menu">
                
                    <li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="/tefuir/">Home</a></li>
                
                    <li class="menu-item menu-item-type-post_type menu-item-object-page"><a href="/tefuir/archives">Archives</a></li>
                
                </ul>
            </div>
    </nav>
</header>

      <div id="main" class="wrapper">
        <div id="primary" class="site-content"><div id="content" role="main"><article id="post-python3-Flask结合Socket-io简单实现在线客服系统" class="post-python3-Flask结合Socket-io简单实现在线客服系统 post type-post status-publish format-standard hentry">
    <!---->

      <header class="entry-header">
        
        
  
    <h1 class="entry-title article-title">
      python3+Flask结合Socket.io简单实现在线客服系统
    </h1>
  

        
        <div class="comments-link">
            
            <a href="javascript:void(0);" data-url="https://yanlidoushikeke.gitee.io/myhexo/2021/04/23/python3-Flask%E7%BB%93%E5%90%88Socket-io%E7%AE%80%E5%8D%95%E5%AE%9E%E7%8E%B0%E5%9C%A8%E7%BA%BF%E5%AE%A2%E6%9C%8D%E7%B3%BB%E7%BB%9F/" data-id="cknzsqfsz000054u0347qel5a" class="leave-reply bdsharebuttonbox" data-cmd="more">Share</a>
        </div><!-- .comments-link -->
      </header><!-- .entry-header -->

    <div class="entry-content">
      
        <h1 id="后端Python3-Flask结合Socket-io配合前端Vue2-0实现简单全双工在线客服系统"><a href="#后端Python3-Flask结合Socket-io配合前端Vue2-0实现简单全双工在线客服系统" class="headerlink" title="后端Python3+Flask结合Socket.io配合前端Vue2.0实现简单全双工在线客服系统"></a>后端Python3+Flask结合Socket.io配合前端Vue2.0实现简单全双工在线客服系统</h1><p>​    Socket.IO 就是一个封装了 Websocket、基于 Node 的 JavaScript 框架，包含 client 的 JavaScript 和 server 的 Node（现在也支持python,go lang等语言）。其屏蔽了所有底层细节，让顶层调用非常简单，另外，Socket.IO 还有一个非常重要的好处。其不仅支持 WebSocket，还支持许多种轮询机制以及其他实时通信方式，并封装了通用的接口。这些方式包含 Adobe Flash Socket、Ajax 长轮询、Ajax multipart streaming 、持久 Iframe、JSONP 轮询等。换句话说，当 Socket.IO 检测到当前环境不支持 WebSocket 时，能够自动地选择最佳的方式来实现网络的实时通信，这一点就比websocket要智能不少。</p>
<p>​    我们先进行后端服务的搭建</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">pip install flask</span><br><span class="line">pip install flask-cors</span><br><span class="line">pip install flask-socketio</span><br></pre></td></tr></table></figure>

<p>​    分别安装Flask本地，跨域模块，以及socketio模块</p>
<p>​    适当升级你的pip，注意版本不要过低，下面是本次demo的版本号</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Flask                 1.1.1</span><br><span class="line">Flask-Cors            3.0.8</span><br><span class="line">Flask-SocketIO        4.3.0</span><br><span class="line">Flask-SQLAlchemy      2.4.1</span><br></pre></td></tr></table></figure>

<p>​    随后我们简单写一个flask的入口启动文件 manage.py</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line">from flask import Flask</span><br><span class="line">from flask_sqlalchemy import SQLAlchemy</span><br><span class="line">import pymysql</span><br><span class="line">from flask import request,jsonify</span><br><span class="line">from flask_cors import CORS</span><br><span class="line">from flask_socketio import SocketIO,send,emit</span><br><span class="line">import urllib.parse</span><br><span class="line"></span><br><span class="line">pymysql.install_as_MySQLdb()</span><br><span class="line"> </span><br><span class="line">app &#x3D; Flask(__name__)</span><br><span class="line"></span><br><span class="line">CORS(app,cors_allowed_origins&#x3D;&quot;*&quot;)</span><br><span class="line"></span><br><span class="line">socketio &#x3D; SocketIO(app,cors_allowed_origins&#x3D;&#39;*&#39;)</span><br><span class="line"> </span><br><span class="line">@socketio.on(&#39;message&#39;)</span><br><span class="line">def handle_message(message):</span><br><span class="line">    message &#x3D; urllib.parse.unquote(message)</span><br><span class="line">    print(message)</span><br><span class="line">    send(message,broadcast&#x3D;True)</span><br><span class="line"></span><br><span class="line">@socketio.on(&#39;connect&#39;, namespace&#x3D;&#39;&#x2F;chat&#39;)</span><br><span class="line">def test_connect():</span><br><span class="line">    emit(&#39;my response&#39;, &#123;&#39;data&#39;: &#39;Connected&#39;&#125;)</span><br><span class="line"></span><br><span class="line">@socketio.on(&#39;disconnect&#39;, namespace&#x3D;&#39;&#x2F;chat&#39;)</span><br><span class="line">def test_disconnect():</span><br><span class="line">    print(&#39;Client disconnected&#39;)</span><br><span class="line"> </span><br><span class="line">if __name__ &#x3D;&#x3D; &#39;__main__&#39;:</span><br><span class="line">    socketio.run(app,debug&#x3D;True,host&#x3D;&quot;0.0.0.0&quot;,port&#x3D;5000)</span><br></pre></td></tr></table></figure>

<p>​    这里简单说一下需要注意的地方，实例化socketio对象的时候，要加上cors_allowed_origins来设置跨域，前后端分离项目让人伤脑筋的地方就是浏览器同源策略问题，而跨域最好由server端来单独配置，这样的好处是当多个前端项目同时共用一套微服务接口时，就不用每个前端项目都配置一次跨域了。</p>
<p>​    我们写了三个基于socketio的视图方法，connect和disconnect顾名思义，当clinet发起连接或者断开时我们可以及时捕获到，而message方法就是前后端进行消息通信的重要方法。</p>
<p>​    发送消息的时候方法加了一个broadcast参数，这是socket.io极具特色的功能，类似广播的效果，可以同时给不同链接的client发送消息，即可以用于聊天，也可以用来做消息推送。</p>
<p>​    最后需要注意的一点是，client发送消息时，最好用urlencode编码一下，这样可以解决中文乱码问题，而在server端，可以用urllib.parse.unquote()来进行解码操作。</p>
<p>​    运行命令启动后端服务</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python3 manage.py</span><br></pre></td></tr></table></figure>

<p><img src="https://v3u.cn/v3u/Public/js/editor/attached/20200624210612_96391.png" alt="img"></p>
<p>​    服务正常启动在5000端口上，就说明后端没有问题了。</p>
<p>​    随后我们来配置前端(client)，前端采用vue2.0框架来驱动，也需要安装socket.io模块</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install vue-socket.io@2.1.0</span><br></pre></td></tr></table></figure>

<p>​    这里一定要指定版本号来安装，版本是2.1.0，因为该依赖的最新版在vue2.0项目中编译时会报错</p>
<p>​    在入口文件main.js中引用</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">import VueSocketio from &#39;vue-socket.io&#39;;</span><br><span class="line"></span><br><span class="line">Vue.use(VueSocketio,&#39;http:&#x2F;&#x2F;127.0.0.1:5000&#39;);</span><br></pre></td></tr></table></figure>

<p>​    注意链接的url是后端服务的地址+端口，千万不要加其他url后缀或者命名空间</p>
<p>​    新建一个index.vue组件来进行模拟用户链接</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br></pre></td><td class="code"><pre><span class="line">&lt;template&gt;</span><br><span class="line">  &lt;div&gt;</span><br><span class="line"></span><br><span class="line">	&lt;div v-for&#x3D;&quot;item in log_list&quot;</span><br><span class="line">	&gt;</span><br><span class="line">	&#123;&#123;item&#125;&#125;</span><br><span class="line">  &lt;&#x2F;div&gt;</span><br><span class="line"></span><br><span class="line">	&lt;input v-model&#x3D;&quot;msg&quot; &#x2F;&gt;</span><br><span class="line"></span><br><span class="line">	&lt;button @click&#x3D;&quot;send&quot;&gt;发送消息&lt;&#x2F;button&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&lt;&#x2F;div&gt;</span><br><span class="line">  </span><br><span class="line">&lt;&#x2F;template&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"> </span><br><span class="line">&lt;script&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">export default &#123;</span><br><span class="line">  data () &#123;</span><br><span class="line">    return &#123;</span><br><span class="line">	  msg: &quot;&quot;,</span><br><span class="line">	  log_list:[]</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br><span class="line">  &#x2F;&#x2F;注册组件标签</span><br><span class="line">  components:&#123;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">  &#125;,</span><br><span class="line">  sockets:&#123;</span><br><span class="line">    connect: function()&#123;</span><br><span class="line">      console.log(&#39;socket 连接成功&#39;)</span><br><span class="line">    &#125;,</span><br><span class="line">    message: function(val)&#123;</span><br><span class="line">	  console.log(&#39;返回:&#39;+val);</span><br><span class="line">	this.log_list.push(val);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;,</span><br><span class="line">  mounted:function()&#123;</span><br><span class="line"></span><br><span class="line">  	</span><br><span class="line">   </span><br><span class="line">  </span><br><span class="line">&#125;,</span><br><span class="line">  methods:&#123;</span><br><span class="line"></span><br><span class="line">	send()&#123;</span><br><span class="line">	  this.$socket.emit(&#39;message&#39;,encodeURI(&quot;用户:&quot;+this.msg));</span><br><span class="line">    &#125;,</span><br><span class="line">  </span><br><span class="line"></span><br><span class="line">     </span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&lt;&#x2F;script&gt;</span><br><span class="line"> </span><br><span class="line">&lt;style&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&lt;&#x2F;style&gt;</span><br></pre></td></tr></table></figure>

<p>​    启动前端服务</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm run dev</span><br></pre></td></tr></table></figure>

<p>​    访问前端页面 <a target="_blank" rel="noopener" href="http://localhost:8080/">http://localhost:8080</a> 可以看到服务成功链接</p>
<p><img src="https://v3u.cn/v3u/Public/js/editor/attached/20200624220630_72542.png" alt="img"></p>
<p>​    这时可以尝试再做一个后台客服的组件页面item.vue，模拟用户和客服分别在不同的电脑进行聊天的场景</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line">&lt;template&gt;</span><br><span class="line">  &lt;div&gt;</span><br><span class="line"></span><br><span class="line">	&lt;div v-for&#x3D;&quot;item in log_list&quot;</span><br><span class="line">	&gt;</span><br><span class="line">	&#123;&#123;item&#125;&#125;</span><br><span class="line">  &lt;&#x2F;div&gt;</span><br><span class="line"></span><br><span class="line">	&lt;input v-model&#x3D;&quot;msg&quot; &#x2F;&gt;</span><br><span class="line"></span><br><span class="line">	&lt;button @click&#x3D;&quot;send&quot;&gt;发送消息&lt;&#x2F;button&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&lt;&#x2F;div&gt;</span><br><span class="line">  </span><br><span class="line">&lt;&#x2F;template&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"> </span><br><span class="line">&lt;script&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">export default &#123;</span><br><span class="line">  data () &#123;</span><br><span class="line">    return &#123;</span><br><span class="line">	  msg: &quot;&quot;,</span><br><span class="line">	  log_list:[]</span><br><span class="line">    &#125;</span><br><span class="line">  &#125;,</span><br><span class="line">  &#x2F;&#x2F;注册组件标签</span><br><span class="line">  components:&#123;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">  &#125;,</span><br><span class="line">  sockets:&#123;</span><br><span class="line">    connect: function()&#123;</span><br><span class="line">      console.log(&#39;socket 连接成功&#39;)</span><br><span class="line">    &#125;,</span><br><span class="line">    message: function(val)&#123;</span><br><span class="line">	  console.log(&#39;返回:&#39;+val);</span><br><span class="line">	  this.log_list.push(val);</span><br><span class="line">	&#125;</span><br><span class="line">&#125;,</span><br><span class="line">  mounted:function()&#123;</span><br><span class="line"></span><br><span class="line">  	</span><br><span class="line">&#125;,</span><br><span class="line">  methods:&#123;</span><br><span class="line"></span><br><span class="line">	send()&#123;</span><br><span class="line">	  this.$socket.emit(&#39;message&#39;,encodeURI(&quot;客服:&quot;+this.msg));</span><br><span class="line">    &#125;,</span><br><span class="line">  </span><br><span class="line"></span><br><span class="line">     </span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&lt;&#x2F;script&gt;</span><br><span class="line"> </span><br><span class="line">&lt;style&gt;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">&lt;&#x2F;style&gt;</span><br></pre></td></tr></table></figure>

<p>​    效果是这样的：</p>
<p><img src="https://v3u.cn/v3u/Public/js/editor/attached/20200624220655_38621.png" alt="img"></p>
<p>​    整个流程还是相对简单的，比起django的dwebsocket模块，socket.io显然更加灵活和方便，如果需要做一些主动推送任务，也可以利用socket.io的广播功能，其原理和实时聊天是一样的。</p>

      
    </div><!-- .entry-content -->

    <footer class="entry-meta">
    <a href="/tefuir/2021/04/23/python3-Flask%E7%BB%93%E5%90%88Socket-io%E7%AE%80%E5%8D%95%E5%AE%9E%E7%8E%B0%E5%9C%A8%E7%BA%BF%E5%AE%A2%E6%9C%8D%E7%B3%BB%E7%BB%9F/">
    <time datetime="2021-04-23T07:54:23.000Z" class="entry-date">
        2021-04-23
    </time>
</a>
    
    
    </footer>
</article>


    
<nav class="nav-single">
    <h3 class="assistive-text">文章导航</h3>
    
        <span class="nav-previous"><a href="/tefuir/2021/04/26/python%E5%9F%BA%E7%A1%80%E7%90%86%E8%AE%BA%E5%AE%9D%E5%85%B8/" rel="prev"><span class="meta-nav">←</span> python基础理论宝典</a></span>
    
    
        <span class="nav-next"><a href="/tefuir/2021/04/23/win10%E7%B3%BB%E7%BB%9F%E4%B8%8B%E5%88%A9%E7%94%A8docker%E9%83%A8%E7%BD%B2gunicorn-Flask%E6%89%93%E9%80%A0%E7%8B%AC%E7%AB%8B%E9%95%9C%E5%83%8F/" rel="next">win10系统下利用docker部署gunicorn+Flask打造独立镜像 <span class="meta-nav">→</span></a></span>
    
</nav><!-- .nav-single -->







</div></div>
        <div id="secondary" class="widget-area" role="complementary">
  
    <aside id="search" class="widget widget_search"><form role="search" method="get" accept-charset="utf-8" id="searchform" class="searchform" action="//google.com/search">
    <div>
        <input type="text" value="" name="s" id="s" />
        <input type="submit" id="searchsubmit" value="搜索" />
    </div>
</form></aside>
  
    
  
    
  
    
  <aside class="widget">
    <h3 class="widget-title">Recents</h3>
    <div class="widget-content">
      <ul>
        
          <li>
            <a href="/tefuir/2021/04/26/python%E5%9F%BA%E7%A1%80%E7%90%86%E8%AE%BA%E5%AE%9D%E5%85%B8/">python基础理论宝典</a>
          </li>
        
          <li>
            <a href="/tefuir/2021/04/23/python3-Flask%E7%BB%93%E5%90%88Socket-io%E7%AE%80%E5%8D%95%E5%AE%9E%E7%8E%B0%E5%9C%A8%E7%BA%BF%E5%AE%A2%E6%9C%8D%E7%B3%BB%E7%BB%9F/">python3+Flask结合Socket.io简单实现在线客服系统</a>
          </li>
        
          <li>
            <a href="/tefuir/2021/04/23/win10%E7%B3%BB%E7%BB%9F%E4%B8%8B%E5%88%A9%E7%94%A8docker%E9%83%A8%E7%BD%B2gunicorn-Flask%E6%89%93%E9%80%A0%E7%8B%AC%E7%AB%8B%E9%95%9C%E5%83%8F/">win10系统下利用docker部署gunicorn+Flask打造独立镜像</a>
          </li>
        
          <li>
            <a href="/tefuir/2021/04/23/win10%E7%B3%BB%E7%BB%9F%E4%B8%8B%E5%9F%BA%E4%BA%8Edocker%E9%85%8D%E7%BD%AEelasticsearch%E9%85%8D%E5%90%88python3%E8%BF%9B%E8%A1%8C%E5%85%A8%E6%96%87%E6%A3%80%E7%B4%A2/">win10系统下基于docker配置elasticsearch配合python3进行全文检索</a>
          </li>
        
          <li>
            <a href="/tefuir/2021/04/23/%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%97%AE%E9%A2%98/">服务器问题</a>
          </li>
        
      </ul>
    </div>
  </aside>

  
    
  
    
  
</div>
      </div>
      <footer id="colophon" role="contentinfo">
    <p>&copy; 2021 南辞
    All rights reserved.</p>
    <p>Powered by <a href="http://hexo.io/" target="_blank">Hexo</a></p>
</footer>
    <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"1","bdMiniList":false,"bdPic":"","bdStyle":"2","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='/js/share.js'];</script>

<script src="/js/jquery-3.3.1.min.js"></script>


  
<link rel="stylesheet" href="/tefuir/fancybox/jquery.fancybox.css">

  
<script src="/tefuir/fancybox/jquery.fancybox.pack.js"></script>




<script src="/tefuir/js/script.js"></script>


<script src="/js/navigation.js"></script>

<div id="bg"></div>

  </div>
</body>
</html>